﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed

#pragma once

#include "GcmpModelInterface.h"
#include "IElement.h"
#include "NdbDataSchema.h"
#include "TiltBox3d.h"
#include "GcmpApiDeclaration.h"

namespace gcmp
{
    /// \brief 三维剖切盒
    class GCMP_MODEL_INTERFACE_EXPORT ISectionBox : public IElement
    {
        DECLARE_CLASS_WITHOUT_DATA_MEMBERS(gcmp, ISectionBox, gcmp::IElement, 038A015C - FF05 - 4965 - BC7E - 1A5FD86C2152, gcmpmodelinterface)

    public:
        virtual ~ISectionBox();

    public:
        /// \brief 获取三维剖切盒所属的视图Id
        /// \return ElementId 剖面盒所属的视图Id
        virtual ElementId GetModelViewId() const = 0;

        /// \brief 获取三维剖切盒的三维紧包围盒
        /// \return TiltBox3d 剖面盒的三维紧包围盒
        virtual TiltBox3d GetTiltBox() const = 0;

        /// \brief 设置三维剖切盒的三维紧包围盒
        /// \param tiltbox 三维紧包围盒
        /// \return bool 是否设置成功（若三维紧包围盒为空包围盒，设置失败，返回false）
        virtual bool SetTiltBox(const TiltBox3d& tiltbox) = 0;

        /// \brief 三维剖切盒是否处于持续修改状态
        /// \return bool 是否处于持续修改状态
        virtual bool IsModifying() const = 0;

        /// \brief 设置三维剖切盒是否处于持续修改状态
        /// \param bool 是否处于持续修改状态
        /// \return bool 是否设置成功
        virtual bool SetIsModifying(bool val) = 0;

        /// \brief 用三维剖切盒剖切形体，保留在三维剖切盒内的部分形体
        /// \param opGrep 需要被三维剖面盒处理的形体
        /// \return OwnerPtr<IGraphicsElementShape> 在三维剖切盒内的部分形体
        GCMP_OBSOLETE_API(2021/02/01, ISectionBox::CropElementShape(OwnerPtr<IGraphicsElementShape>, bool*)) virtual OwnerPtr<IGraphicsElementShape> CropElementShape(OwnerPtr<IGraphicsElementShape> opGrep) const = 0;

        /// \brief 用三维剖切盒剖切形体，保留在三维剖切盒内的部分形体
        /// \param opGrep 需要被三维剖面盒处理的形体
        /// \param isFailed 是否切割失败,如不打算处理切割失败得问题，可传nullptr
        /// \return OwnerPtr<IGraphicsElementShape> 在三维剖切盒内的部分形体
        virtual OwnerPtr<IGraphicsElementShape> CropElementShape(OwnerPtr<IGraphicsElementShape> opGrep, bool* isFailed) const = 0;

        /// \brief 获取三维紧包围盒的RdId
        /// \param 
        /// \return 三维紧包围盒的RdId
        virtual RegenDataId GetTiltBoxRegenDataId() const = 0;

    public:
        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static UniIdentity GetImplementationUid();
    };
}


